﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Web;
//using Unity;

namespace apiframworkTest.Common
{
    /// <summary>
    /// unity 依赖注入/AOP
    /// </summary>
    public  class UnityContainerHelp
    {
        //private static IUnityContainer container;

        public UnityContainerHelp()
        {
            //container = new UnityContainer();
            //UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
            //container.LoadConfiguration(section, "aopContainer");
        }

         static UnityContainerHelp()
        {
            //container = new UnityContainer();
            //ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
            //fileMap.ExeConfigFilename = Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "CfgFiles\\Unity.Config");
            //Configuration configuration = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
            //UnityConfigurationSection configSection = (UnityConfigurationSection)configuration.GetSection(UnityConfigurationSection.SectionName);
            //configSection.Configure(container, "aopContainer");
        }
     
        //public  T GetServer<T>()
        //{
        //    //return container.Resolve<T>();
        //}

    }
}